Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor to a python module and add tests #32

Merged
merged 11 commits into from
Nov 19, 2023
Merged

refactor to a python module and add tests #32

merged 11 commits into from
Nov 19, 2023

Conversation

rbavery
Copy link
Collaborator

@rbavery rbavery commented Sep 20, 2023

This adds tests with pytest and factors out decode and encode logic to a sam_serve module so that it was easier to test. It also adds a section in the README with a guide for locally testing the decoder with pytest. The module sam_serve is installed in each service Dockerfile from a python wheel file that needs to be generated with hatch build. This can also be uploaded to pypi with hatch publish

The notebook example has also been updated to reflect the new handler structure. payloads to the decoder need to have a "decode_type" specified that can be any one of

"single_point" (implemented)

not implemented
"multi_point"
"bbox"

the payload should also have an input_prompt key isntead of the previous "input_point" key to reflect that the prompt can be a point, multiple foreground points, multiple foreground and multipkle background points, a bbox, etc.

we might want to change these endpoints to reflect all the variations.

I tested both gpu and cpu services locally. Would appreciate a review if you have time @Rub21 . Then we can merge in your recent work on #25

@rbavery rbavery requested a review from Rub21 November 15, 2023 07:42
@rbavery rbavery merged commit 5fe74fc into main Nov 19, 2023
5 checks passed
@rbavery rbavery deleted the refactor branch November 19, 2023 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant